<html>
<head>
<script language="javascript">
function aone(id)
{
if(id=="id1")
 document.getElementById(id).innerText="<table><tbody><tr><td>asdlfkj</td></tr></tbody></table>";
else
 document.getElementById(id).innerHTML="<table><tbody><tr><td>asdlfkj</td></tr></tbody></table>";
}
</script>
</head>

<body>
<div id="id1"><a href="#" onclick="aone('id1')">textContent</a></div>
<div id="id2"><a href="#" onclick="aone('id2')">innerHTML</a></div>
</body>
</html>